<template>
  <div class="search">
    <input type="text" placeholder="请输入内容" v-model="inputVal" />
    <span @click="search">搜索</span>
  </div>
</template>
<script>
export default {
  data() {
    return {
      inputVal: "",
    };
  },
  methods: {
    search() {
      this.$store.commit("addhistory", this.inputVal);
      this.$router.push({ path: "/relute", query: { md: this.inputVal } });
    },
  },
};
</script>